//
//  TKHqWarningCenter.h
//  TKApp
//  预警通知中心
//  Created by liupm on 15-3-23.
//  Copyright (c) 2015年 liubao. All rights reserved.
//

#import <Foundation/Foundation.h>

UIKIT_EXTERN NSString *const TKIMNotificationDidReceiveRemoteNotification;

@protocol TKIMNotificationCenterDelegate <NSObject>

/**
 *  @Author lpm, 15-06-16 09:06:42
 *
 *  @brief  注册远程通知委托
 */
-(void)registerForRemoteNotification;

@end

@interface TKIMNotificationCenter : NSObject

@property(nonatomic,weak) id<TKIMNotificationCenterDelegate> delegate;
@property(nonatomic,copy) NSString *cacheToken;

/**
 * @Author lpm, 15-03-24 16:03:41
 *
 * @brief  单例
 * @return
 */
+(TKIMNotificationCenter *)shareInstance;


/**
 * @Author lpm, 15-03-23 16:03:19
 *
 * @brief  开始
 */
-(void)start;


/**
 * @Author lpm, 15-03-23 16:03:49
 *
 * @brief  停止
 */
-(void)stop;


/**
 *  @Author lpm, 15-11-23 15:11:43
 *
 *  @brief  收到推送消息
 *
 *  @param userInfo
 */
-(void)didReceiveRemoteNotification:(NSObject *)userInfo;


/**
 *  @Author lpm, 15-11-23 15:11:43
 *
 *  @brief  收到推送消息
 *
 *  @param userInfo
 */
-(void)didReceiveLocalNotification:(NSObject *)userInfo;


/**
 *  @Author lpm, 15-11-23 15:11:15
 *
 *  @brief  注册推送通知成功
 *
 *  @param userInfo
 */
-(void)didRegisterForRemoteNotification:(NSData *)userInfo;


/**
 *  @Author lpm, 15-11-23 15:11:36
 *
 *  @brief  注册推送通知失败
 *
 *  @param userInfo
 *  @param error
 */
-(void)didFailToRegisterForRemoteNotification:(NSObject *)userInfo error:(NSError *)error;


/**
 *  @Author lpm, 15-11-23 15:11:21
 *
 *  @brief  用户是否允许推送
 *
 *  @return
 */
- (BOOL)isAllowedNotification;


/**
 *  @Author lpm, 15-12-15 15:12:41
 *
 *  @brief  发送一个本地通知
 *
 *  @param title 通知标题
 *  @param body 通知内容
 *  @param userInfo 参数
 */
-(void)postLocalNotification:(NSString *)title body:(NSString *)body userInfo:(NSDictionary *)userInfo;

@end
